<template>
    <section>

        <!--编辑界面-->

        <el-form :model="currObj" label-width="80px" ref="currObj">
            <el-form-item label="名称" prop="name">
                <el-input v-model="currObj.name" auto-complete="off"></el-input>
            </el-form-item>
            <el-form-item label="编号" prop="name">
                <el-input v-model="currObj.code" auto-complete="off"></el-input>
            </el-form-item>

            <el-form-item label="备注">
                <el-input type="textarea" v-model="currObj.memo"></el-input>
            </el-form-item>

            <el-form-item label="订单">

                <el-table :data="customerOrderList">
                    <el-table-column prop="name" label="图片" width="100">
                        <template scope="scope">
                            <img class='listImg' :src='scope.row.imgUrl'>
                        </template>
                    </el-table-column>
                    <el-table-column width="60">
                        <template scope="scope">

                            <el-popover ref="popover5" placement="right" width="500px" v-model="scope.row.show">
                                <div v-if="scope.row.show">
                                    <customerOrderShow :customerOrderId="scope.row._id"></customerOrderShow>
                                </div>
                            </el-popover>

                            <el-button size="small" v-popover:popover5><i class="fa fa-eye"></i></el-button>

                        </template>
                    </el-table-column>
                    <el-table-column prop="name" label="订单标题">


                        <template scope="scope">
                            <div>
                                <h3>编号:{{scope.row.code}}</h3>
                                <h3>样衣款号:{{getModelNo(scope.row).proof}}</h3>
                                <h3>大货款号:{{getModelNo(scope.row).bulk}}</h3>
                                <h3>订单名称:{{scope.row.name}} </h3>
                            </div>
                        </template>

                    </el-table-column>
                    <el-table-column label="收款金额" width="120">
                        <template scope="scope">
                            <div>金额: <span v-text="scope.row.count.amount" ></span></div>
                            <div>已收: <span v-text="scope.row.count.reAmount"></span></div>
                        </template>
                    </el-table-column>

                    <el-table-column label="状态" width="120">
                        <template scope="scope">
                            <span v-text="getStatusName(scope.row.statusId)"></span>

                        </template>
                    </el-table-column>
                    <el-table-column label="详情" width="120">
                        <template scope="scope">
                            <el-button size="small" @click="getCustomerOrder(scope.row)">详情</el-button>

                        </template>
                    </el-table-column>
                    <!--<el-table-column label="打样" min-width="180" prop='createTime' :formatter="fmtDate">

			</el-table-column>
			<el-table-column label="大货" min-width="180" prop='createTime' :formatter="fmtDate">

			</el-table-column>-->


                </el-table>

            </el-form-item>

        </el-form>
        <el-dialog title="订单结算详情" v-model="showCustomerOrder" :modal='false' :close-on-click-modal="false" size='full'>
            <div>


                <el-table row-key="id" :data="customerOrderDetail">
                    <el-table-column prop="name" label="创建时间" width='150'>
                        <template scope="scope">
                            <span v-text="getDateStr(scope.row.createTime)"></span>
                        </template>
                    </el-table-column>
                    <el-table-column prop="name" label="收款名称">
                        <template scope="scope">
                            <span v-text="scope.row.name"></span>

                        </template>
                    </el-table-column>
                    <el-table-column label="提交结算人" width='120'>
                        <template scope="scope">
                            <el-tag type="primary">{{scope.row.sendMemberName}}</el-tag>
                        </template>
                    </el-table-column>

                    <el-table-column label="收款时间" width='150'>
                        <template scope="scope">
                            <span v-text="getDateStr(scope.row.collectionTime)"></span>
                        </template>
                    </el-table-column>
                    <el-table-column label="到账时间" width='150'>
                        <template scope="scope">
                            <div v-if="scope.row.statusId>=200">
                                <span v-text="getDateStr(scope.row.paymentTime)"></span>
                            </div>
                            <div v-else>

                                <span>-</span>
                            </div>


                        </template>
                    </el-table-column>
                    <el-table-column label="状态" width='90'>
                        <template scope="scope">
                            <span v-text="getSettlementStatusName(scope.row.statusId)"></span>

                        </template>
                    </el-table-column>
                    <el-table-column label="备注">
                        <template scope="scope">
                            <span v-text="scope.row.memo"></span>
                        </template>
                    </el-table-column>
                    <el-table-column label="金额">
                        <template scope="scope">
                            <span v-text.number="scope.row.amount"></span>

                        </template>
                    </el-table-column>
                    <el-table-column label="到账金额">
                        <template scope="scope">
                            <el-input-number style="width:60px;      vertical-align: middle " v-model="scope.row.reAmount" size="small" :controls='false'></el-input-number>


                        </template>
                    </el-table-column>
                    <el-table-column label="操作" width="80">
                        <template scope="scope">
                            <el-button size="small" @click="reItem(scope.row ,scope.$index)">到账</el-button>

                        </template>
                    </el-table-column>
                </el-table>

            </div>
            <!--<div slot="footer" class="dialog-footer">
                <el-button @click.native="showCustomerOrder=false">取消</el-button>

                <el-button type="primary" @click.native="reAll()">全部到账</el-button>
            </div>-->
        </el-dialog>
    </section>

</template>
<script src="./SettlementInfo.js"></script>

<style lang="scss" scoped>
    .card {
        margin-right: 10px;
        margin-bottom: 10px;
    }

    .btn_1 {}

    .listImg {

        width: 50px;
        height: 50px;
        margin-top: 5px;
    }

    h3 {
        font-weight: normal;
        font-size: 13px;
        line-height: 20px;
        margin: 5px 0 5px 0
    }
</style>